﻿@model IList<PaymentHelper.PaymentFlow.ModelTemplate.MethodModel>
@using PaymentHelper.PaymentFlowTemplates.Default.Models;           
           
@{
    ViewBag.Title = ViewBag.Resources["DefaultPaymentFlow.PaymentMethodTitle"];

    if (!string.IsNullOrEmpty(PaymentHelper.PaymentFlow.PaymentFlowManager.Layout))
    {
        Layout = PaymentHelper.PaymentFlow.PaymentFlowManager.Layout;
    }
}

<div class="@ViewBag.CssClass">
    
    @Html.Action("PaymentSteps","DefaultTemplate", new { step = PaymentStep.MethodPayment })

    @using (Html.BeginForm("Methods", "DefaultTemplate", FormMethod.Post))
    {
        <div class="payment_content">
            @Html.ValidationSummary()
            <fieldset>
                <legend>@ViewBag.Resources["DefaultPaymentFlow.Methods"]</legend>
                @if (Model.Count > 0)
                {
                    <table style="margin: 0px;">
                        <thead>
                            <tr>
                                <td>
                                    &nbsp;
                                </td>
                                <td>
                                    @ViewBag.Resources["DefaultPaymentFlow.MethodName"]
                                </td>
                                <td style="width: 75px;">
                                    @ViewBag.Resources["DefaultPaymentFlow.FeePayment"]
                                </td>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach (var method in Model)
                            {
                                <tr>
                                    <td>
                                        @Html.RadioButton("method", method.SystemName, true)
                                    </td>
                                    <td>
                                        <p class="friendlyname_method">@method.FriendlyName</p>
                                        <p class="shortdes_method">@method.ShortDescription</p>
                                    </td>
                                    <td>
                                        <b>@method.Fee</b>
                                    </td>
                                </tr>
                            }
                        </tbody>
                    </table>
                }
                else
                {
                    <p style="border: 1px dotted red; padding: 8px; font-weight: bold;">
                        @ViewBag.Resources["DefaultPaymentFlow.NoMethod"]
                    </p>
                }
            </fieldset>

            @if (ViewBag.ShowCart)
            {
                @Html.Action("ShowCart", "DefaultTemplate");
            }

        </div>
        <div class="btn_control">
            <p style="text-align: center;">
                <input type="button" value="@ViewBag.Resources["DefaultPaymentFlow.Cancle"]" onclick="location.href='@Url.RouteUrl("DefaultTemplate.Cancle")'" class="btn_ph_payment"/>
                <input type="submit" name="ph_nextstep" value="@ViewBag.Resources["DefaultPaymentFlow.NextStep"]" class="btn_ph_payment"/>
            </p>
        </div>
    }
</div>
